package com.lphl.pet.activity;

import com.lphl.pet.R;
import com.lphl.pet.adapter.ChoosePetActivityAdapter;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

public class ChoosePetActivity extends Activity implements OnClickListener {

	private ListView lv_choose_pet;
	private LinearLayout ll_add_pet;
	private TextView tv_add_pet;
	private ImageView iv_back;

	
	private Handler handler = new Handler(){
		public void handleMessage(android.os.Message msg) {
			
		};
	};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_choose_pet);
		
		initView();
	}

	private void initView() {
		iv_back = (ImageView) findViewById(R.id.iv_back);
		tv_add_pet = (TextView) findViewById(R.id.tv_add_pet);
		lv_choose_pet = (ListView) findViewById(R.id.lv_choose_pet);
		ll_add_pet = (LinearLayout) findViewById(R.id.ll_add_pet);
		
		iv_back.setOnClickListener(this);
		tv_add_pet.setOnClickListener(this);
		ll_add_pet.setOnClickListener(this);
		
		
		
		lv_choose_pet.setAdapter(new ChoosePetActivityAdapter(ChoosePetActivity.this));
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.iv_back:
			this.finish();
			break;
			
		case R.id.tv_add_pet:
		case R.id.ll_add_pet:
			Intent intent = new Intent(ChoosePetActivity.this, SerchDeviceActivity.class);
			startActivity(intent);
			break;
			
		default:
			break;
		}
	}
}